package com.signway.harmony_demo.utils;

import java.security.SecureRandom;

public class CommonUtil {
    private CommonUtil() {
    }

    /**
     * get random number
     * @param num
     * @return int Random [0-num)
     */
    public static int getRandom(int num) {
        int randomInt = 0;
        if (num > 0) {
            SecureRandom random = new SecureRandom();
            randomInt = random.nextInt(num);
        }
        return randomInt;
    }
}
